﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;

namespace Nirvana
{
    [AddComponentMenu("Nirvana/UI/Bind/Variable Bind Toggle")]
    [RequireComponent(typeof(Toggle))]
    public class UIVariableBindToggle : UIVariableBindBool
    {
        private Toggle _toggle;

        protected override void OnValueChanged()
        {
            if (this._toggle == null)
            {
                this._toggle = base.GetComponent<Toggle>();
            }
            this._toggle.isOn = base.GetResult();
        }


    }
}

